<SCRIPT LANGUAGE="JavaScript">
<!--
	var tool =
{
    restyle : function(e)
    {
        e.style.cssText = 'margin:0;padding:0;background-image:none;background-color:transparent;border:0;';
    },

    ststyle : function(e, dict)
    {
        var style = e.style;
        for (var n in dict) style[n] = dict[n];
    },

	stclass : function(e, dict)
    {
        var cls = e.style;
        for (var n in dict) style[n] = dict[n];
    },

    getestyle : function(e, p)
    {
        if (binfo.ie)
            return e.currentStyle[p];
        else
            return e.ownerDocument.defaultView.getComputedStyle(e, '').getPropertyValue(p);
    },

    stopac : function(e, opac)
    {
        if (binfo.ie)
        {
            opac = Math.round(opac * 100);
            e.style.filter = ( opac > 100 ? '' : 'alpha(opacity=' + opac + ')' );
        }
        else
            e.style.opacity = opac;
    },

    getvoid : function()
    {
        if (binfo.ie)
            return ( binfo.i7 ? '' : 'javascript:\'\'' );
        return 'javascript:void(0)';
    },
    //����¼�
    addevt : function(o, e, l)
    {
        if (binfo.ie)
            o.attachEvent('on' + e, l);
        else
            o.addEventListener(e, l, false);
    },
    //ȥ���¼�
    remevt : function(o, e, l)
    {
        if (binfo.ie)
            o.detachEvent('on' + e, l);
        else
            o.removeEventListener(e, l, false);
    },

    isdtd : function(doc)
    {
        return ( 'CSS1Compat' == ( doc.compatMode || 'CSS1Compat' ) );
    },

    getclsize : function(w)
    {
        if (binfo.ie)
        {
            var oSize, doc = w.document.documentElement;
            oSize = ( doc && doc.clientWidth ) ? doc : w.document.body;

            if (oSize)
                return { w : oSize.clientWidth, h : oSize.clientHeight };
            else
                return { w : 0, h : 0 };
        }
        else
            return { w : w.innerWidth, h : w.innerHeight };
    },

    getev : function()
    {
        if (binfo.ie) return window.event;
        var func = tool.getev.caller;
        while (func != null)
        {
            var arg = func.arguments[0];
            if (arg && (arg + '').indexOf('Event') >= 0) return arg;
            func = func.caller;
        }
        return null;
    },

    getepos : function(o)
    {
        var l, t;
        if (o.getBoundingClientRect)
        {
            var el = o.getBoundingClientRect();
            l = el.left;
            t = el.top;
        }
        else
        {
            l = o.offsetLeft - Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
            t = o.offsetTop - Math.max(document.documentElement.scrollTop, document.body.scrollTop);
        }
        return { x : l, y : t };
    },

    getspos : function(w)
    {
        if (binfo.ie)
        {
            var doc = w.document;
            var oPos = { X : doc.documentElement.scrollLeft, Y : doc.documentElement.scrollTop };
            if (oPos.X > 0 || oPos.Y > 0) return oPos;
            return { X : doc.body.scrollLeft, Y : doc.body.scrollTop };
        }
        else
            return { X : w.pageXOffset, Y : w.pageYOffset };
    },

    getlink : function(c)
    {
        if (c.length == 0) return;
        return '<' + 'link href="' + c + '" type="text/css" rel="stylesheet"/>';
    },

    regdoll : function(w)
    {
        if (binfo.ie)
            w.$ = w.document.getElementById;
        else
            w.$ = function(id) {
                return w.document.getElementById(id);
            };
    },

    getedoc : function(e)
    {
        return e.ownerDocument || e.document;
    },

    disctmenu : function(doc)
    {
        doc.oncontextmenu = function(e)
        {
            e = e || event || this.parentWindow.event;
            var o = e.srcElement || e.target;
            if (!( o.type == 'password' || o.type == 'text' || o.type == 'textarea' ))
            {
                if (binfo.ie) e.returnValue = false; else e.preventDefault();
            }
        };
    },

    getpath : function()
    {
        var bp, len, sc = document.getElementsByTagName('script');
        for (var i = 0; i < sc.length; i++)
        {
            bp = sc[i].src.substring(0, sc[i].src.toLowerCase().indexOf('lhgdialog.js'));
            len = bp.lastIndexOf('/');
            if (len > 0) bp = bp.substring(0, len + 1);
            if (bp) break;
        }
        if (binfo.ie && bp.indexOf('../') != -1)
        {
            var fp = window.location.href;
            fp = fp.substring(0, fp.lastIndexOf('/'));
            while (bp.indexOf('../') >= 0)
            {
                bp = bp.substring(3);
                fp = fp.substring(0, fp.lastIndexOf('/'));
            }
            return fp + '/' + bp;
        } else return bp;
    },

    //ɾ��ڵ�
    remnode : function(n) {
        return n.parentNode.removeChild(n);
    }
};
vtools = {
	$:function(id){
		return document.getElementById(id);	
	},
	addclass:function(e,c){
		var ocn = this.$(e).className;
		var cn = ocn.split(" ");
		if(this.classFilter(cn,c)==c){
			ocn = ocn;
		}else{
			ocn =ocn+" "+c;
		}
		this.$(e).className = ocn;
	},
	removeclass:function(e,c){
		var ocn = this.$(e).className;
		var cn = ocn.split(" ");
		var nocn = this.classFilter(cn,c,true);
		var temp="";
		var len=nocn.length*1;
		for (i = 0; i < len; i++)
		{
			if (i==0)
			{
				temp=temp+nocn[i];
			}else
			{
				temp=temp+" "+nocn[i];
			}
			
		}
		this.$(e).className = temp;
	},
	classFilter: function(r,m,not){
		m = " " + m + " ";
		var tmp = [];
		for ( var i = 0; r[i]; i++ ) {
			var pass = (" " + r[i] + " ").indexOf( m ) >= 0;
			if ( !not && pass || not && !pass )
				tmp.push( r[i] );
		}
		return tmp;
	},
	comptagName:function(e,t){
		return this.$(e).parentNode.tagName.toUpperCase() == t.toUpperCase();
	},
	getattr:function(e,t){
		return this.$(e).getAttribute(t);
	},
	creatqtip:function(){
		
	},
	getattr:function(e,t){
		if (t=='value'){
			var temp=this.$(e).value;
		}else{
		 	var temp=this.$(e).getAttribute(t);
		 }
		if (temp != null && "" != temp) {
			return temp.replace(/(^\s*)|(\s*$)/g,"");
		}
		else 
			return '';

	}
};
function test(){

	alert(vtools.getattr("viewEdit_pmkbh",'value'));

}



//-->
</SCRIPT>

<body>
<div>
 <input type="text" class="input_text" id="viewEdit_pmkbh" name="model.pmkbh" abc="" style="width: 130px;" validatorRules="Require,pmkbh" maxlength="25" dataType="Custom" msg="长度不超过25个字">
  </input>
  <INPUT TYPE="button" VALUE="" ONCLICK="test();"></body>